package org.walkerljl.practice.mock.mockito;

import org.junit.Test;

import java.util.Iterator;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.*;

public class SimpleTest {

    @Test
    public void simpleTest() {
        Iterator i = mock(Iterator.class);
        when(i.next()).thenReturn("Hello").thenReturn("World");
        String result = i.next() + " " + i.next();
        verify(i, times(2)).next();
        assertEquals("Hello World", result);
    }
}